#ifndef __SYNC_OBJ_H__
#define __SYNC_OBJ_H__

#include "non_copyable.h"


namespace Boss
{

  template <typename T>
  class SyncObj
    : private NonCopyable
  {
  public:
    SyncObj(T &obj)
      : Obj(obj)
    {
      Obj.Lock();
    }
    ~SyncObj()
    {
      Obj.UnLock();
    }

  private:
    T &Obj;
  };

}

#endif  // !__SYNC_OBJ_H__
